From 495adc0b6a288490c36081d14907f9863e43fc73 Mon Sep 17 00:00:00 2001 From: "ack@localhost.localdomain" Date: Fri, 30 Jun 2006 17:12:05 +0100 Subject: [PATCH] Don't modify global active weight when changing weight of inactive domain. Signed-off-by: Emmanuel Ackaouy --- xen/common/sched_credit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 3b804cd644..98e1e3e6c1 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -622,9 +622,12 @@ csched_dom_cntl( if ( cmd->u.credit.weight != 0 ) { - csched_priv.weight -= sdom->weight; + if ( !list_empty(&sdom->active_sdom_elem) ) + { + csched_priv.weight -= sdom->weight; + csched_priv.weight += cmd->u.credit.weight; + } sdom->weight = cmd->u.credit.weight; - csched_priv.weight += sdom->weight; } if ( cmd->u.credit.cap != (uint16_t)~0U ) -- 2.30.2